<?php 

$page_title = "Sorsolás után a játékosok törlése";

$page_text = "";

if ($_POST['action']=="torles"){
	/*
	print "<pre>";
	print_R($_POST);
	print "</pre>";
	*/
	
	$id = $sql->escape($_POST['test_id']);
	
	if ( $sql->mysql_delete("upload","`upload-gallery` = ".$id) ){
		$page_text .= "
		<div class='ui-widget admin_message'>
			<div style='padding: 0 .7em;' class='ui-state-default ui-corner-all'> 
				<p>
					<span style='float: left; margin-right: .3em;' class='ui-icon ui-icon-notice'></span>
					A galériába feltöltőket sikeresen kitöröltük az adatbázisból
				</p>
			</div>
		</div>";
	}else{
		$page_text .= "
		<div class='ui-widget admin_message'>
			<div style='padding: 0 .7em;' class='ui-state-default ui-corner-all'> 
				<p>
					<span style='float: left; margin-right: .3em;' class='ui-icon ui-icon-error'></span>
					Hiba történt kérem próbálja meg újra később!<br />
					Hibaüzenet: ".$sql->mysql_error."
				</p>
			</div>
		</div>";
	}
}


$page_text .= "
<form enctype='multipart/form-data' method='post' action='index.php?torles'>
	<input type='hidden' value='torles' name='action'>
	
	<div class='fieldset'>
		<div class='legend'>
			<span class='left title'>Teszt neve</span>
			<span class='ui-icon ui-icon-info help-box left' info-title='Teszt neve' info-text='Ezt a tesztet kitöltőket fogjuk törölni'></span>
		</div>
		<div class='clear'></div>
		<select class='select ui-widget-content ui-state-default ui-corner-all' name='test_id'>
";

$sql->mysql_select("gallery", "*");
while($row = $sql->get_line())
{
	$page_text .= "<option value='".$row['gallery_id']."'>".$row['gallery_name']."</option>";
}

$page_text .= "
		</select>
	</div>
	
	<div class='admin_button'>
		<input type='submit' class='ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only' value='Törlés' />
	</div>
	
</form>
";


?>